﻿@model IEnumerable<AppNet.Models.News>

@{
    ViewBag.Title = "Index";
    
}
<style >
    .display-table
    {
        
    }
</style>

<h2>@AppNet.MultiLanguage.Translation.GetInstance.Translate("NewsManagement")</h2>

<p>
    @Html.ActionLink(@AppNet.MultiLanguage.Translation.GetInstance.Translate("NewCreate"), "Create")
</p>
<table class="display-table">
    <tr>
    <th>
       @AppNet.MultiLanguage.Translation.GetInstance.Translate("Category")
    </th>
    
        
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("Title")
        </th>
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("Description")
        </th>
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("Content")
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Tags)
        </th>
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("Lang")
        </th>
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("Img")
        </th>
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("Date")
        </th>
        <th>
                 @AppNet.MultiLanguage.Translation.GetInstance.Translate("CatVisible")
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
    
        <td>
            @Html.DisplayFor(modelItem => item.Category.Title)
        </td>
      
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Content)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Tags)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Lang)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StringImg)
        </td>
        
        <td>
            @Html.DisplayFor(modelItem => item.Date)
        </td>
          <td>
          @if (item.IsVisible == true)
          {
              <p>Visible</p>
          }
          else
          {
          <p>Invisible</p>
          }
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
